// source --> https://www.gtwins.co.kr/wp-content/plugins/mangboard/assets/js/common.js?ver=1.7.8 function sendFormDataRequest(form, action, successCallback, errorCallback, type, dataType){ if(typeof(type)==='undefined') type = "POST"; if(typeof(dataType)==='undefined') dataType = "json"; if(typeof(successCallback)==='undefined') successCallback = function s(a,b){}; if(typeof(errorCallback)==='undefined') errorCallback = function e(a){}; if(String(action).indexOf('http')!==0){ action = mb_ajax_object.ajax_url+"?action="+action+"&admin_page="+mb_ajax_object.admin_page+"&hybrid_app="+mb_hybrid_app; } form.attr("action", action); form.ajaxForm({ type: type, async: true, crossDomain: true, dataType : dataType, xhrFields:{withCredentials:true}, success:function(data, state){ hideLoadingBox(); successCallback(data, state); },error:function(e){ //console.log(JSON.stringify(e)); hideLoadingBox(); if(e.responseJSON && e.responseJSON.state=="success"){ successCallback(e.responseJSON, e.responseJSON.state); }else{ errorCallback(e); } } }); showLoadingBox(); form.submit(); } function sendDataRequest(action, param, successCallback, errorCallback, type, dataType){ if(typeof(type)==='undefined') type = "POST"; if(typeof(dataType)==='undefined') dataType = "json"; if(typeof(successCallback)==='undefined') successCallback = function s(a,b){}; if(typeof(errorCallback)==='undefined') errorCallback = function e(a){}; if(param.indexOf('mb_nonce_value=')==-1){ if(param=="") param = mb_options["nonce"]; else param = param+"&"+mb_options["nonce"]; } if(String(action).indexOf('http')!==0){ param = param+"&action="+action+"&admin_page="+mb_ajax_object.admin_page+"&hybrid_app="+mb_hybrid_app; action = mb_ajax_object.ajax_url; } if(param.indexOf('board_action=board_hit')==-1) showLoadingBox(); jQuery.ajax({ url: action, type: type, data: param, success:function(data,state){ hideLoadingBox(); successCallback(data, state); },error:function(e){ //console.log(JSON.stringify(e)); hideLoadingBox(); if(e.responseJSON && e.responseJSON.state=="success"){ successCallback(e.responseJSON, e.responseJSON.state); }else{ errorCallback(e); } },timeout: 15000, cache: false, dataType: dataType }); } function sendDataRequest2(action, param, successCallback, errorCallback, type, dataType){ if(typeof(type)==='undefined') type = "POST"; if(typeof(dataType)==='undefined') dataType = "json"; if(typeof(successCallback)==='undefined') successCallback = function s(a,b){}; if(typeof(errorCallback)==='undefined') errorCallback = function e(a){}; if(param.indexOf('mb_nonce_value=')==-1){ if(param=="") param = mb_options["nonce"]; else param = param+"&"+mb_options["nonce"]; } if(String(action).indexOf('http')!==0){ param = param+"&action="+action+"&admin_page="+mb_ajax_object.admin_page+"&hybrid_app="+mb_hybrid_app; action = mb_ajax_object.ajax_url; } jQuery.ajax({ url: action, type: type, data: param, success:function(data,state){ successCallback(data, state); },error:function(e){ //console.log(JSON.stringify(e)); hideLoadingBox(); errorCallback(e); },timeout: 15000, cache: false, dataType: dataType }); } function mb_insertHtml(name,message){ jQuery(name).html(message); } function mb_appendHtml(name,message){ jQuery(name).append(message); } function checkCSSDisplay(name,time){ if(typeof(time)==='undefined') time = 0; var objTarget = jQuery(name); if(objTarget.css("display")=="none"){ if(time==0) objTarget.show(); else objTarget.slideDown( time ); }else{ if(time==0) objTarget.hide(); else objTarget.slideUp( time ); } } function checkCSSDisplayID(id,time){ if(typeof(time)==='undefined') time = 0; var objTarget = jQuery("#"+id); if(objTarget.css("display")=="none"){ if(time==0) objTarget.show(); else objTarget.slideDown( time ); }else{ if(time==0) objTarget.hide(); else objTarget.slideUp( time ); } } function checkBoxDisplayID(obj, id){ if(jQuery(obj).prop('checked')){ jQuery("#"+id).show(); }else{ jQuery("#"+id+" input").val(""); jQuery("#"+id).hide(); } } function set_category_data(data, id,value){ if(typeof(data)!=='undefined'){ jQuery("#"+id+" option").remove(); var index = id.substr(-1); if(typeof(mb_languages["selectbox"+index])!='undefined' && mb_languages["selectbox"+index]!="") jQuery("#"+id).append(''); if(typeof(data)==='object'){ jQuery.each(data, function(key, entry) { if(value!="" && key==value){ jQuery("#"+id).append(''); }else{ jQuery("#"+id).append(''); } }); jQuery("#"+id).css("display","inline-block"); }else{ jQuery("#"+id).html(''); jQuery("#"+id).hide(); } }else{ jQuery("#"+id).html(''); jQuery("#"+id).hide(); } } function movePage(url, param){ moveURL(url, param) } function moveViewPage(pid,board_name,page){ var param = "mode=view&board_pid="+pid; if(typeof(board_name)!=='undefined'&& board_name!="") param = param+"&board_name="+board_name; if(typeof(page)!=='undefined' && page!="") param = param+"&page="+page; moveURL("", param) } function moveURL(url, param, loading){ var isLoading = true; if(typeof(loading)!=='undefined') isLoading = loading; if(isLoading) showLoadingBox(); if(typeof(param)!=='undefined' && param!=""){ if(url.indexOf('?')==-1){ url = url+'?'; }else{ url = url+'&'; } url = url+param; } if(url=="reload"){ window.location.reload(); }else if(url=="back"){ window.history.back(); }else if(url=="forward"){ window.history.forward(); }else if(url=="referer" || url=="referrer"){ url = document.referrer; if(url.indexOf('%26')==-1){ url = decodeURIComponent(url); }else{ url = url.replace(/%26/g,"##26##"); url = decodeURIComponent(url); url = url.replace(/##26##/g,"%26"); } window.location.href = url; }else{ if(url.indexOf('%26')==-1){ url = decodeURIComponent(url); }else{ url = url.replace(/%26/g,"##26##"); url = decodeURIComponent(url); url = url.replace(/##26##/g,"%26"); } window.location.href = url; } } function openWindow(url,name,option){ var objPopup; if(typeof(mb_hybrid_app)==='undefined' || mb_hybrid_app==""){ if(typeof(option)==='undefined') option = "width=600,height=450,toolbar=no,location=no,status=no,menubar=no,top=200,left=300,scrollbars=no,resizable=no"; var android = navigator.userAgent.indexOf('Android') != -1; if(android) objPopup = window.open(url,name); else objPopup = window.open(url,name,option); }else{ objPopup = openMobileWindow(url,name,option); } return objPopup; } function category_select(index){ if(index==0){ set_category_data(category_data,mb_options["board_name"]+"_category1",mb_categorys["value1"]); if(mb_categorys["value1"]!=undefined && mb_categorys["value1"]!=""){ set_category_data(category_data[jQuery("#"+mb_options["board_name"]+"_category1 option:selected").val()],mb_options["board_name"]+"_category2",mb_categorys["value2"]); }else jQuery("#"+mb_options["board_name"]+"_category2").hide(); if(mb_categorys["value2"]!=undefined && mb_categorys["value2"]!=""){ set_category_data(category_data[jQuery("#"+mb_options["board_name"]+"_category1 option:selected").val()][jQuery("#"+mb_options["board_name"]+"_category2 option:selected").val()],mb_options["board_name"]+"_category3",mb_categorys["value3"]); }else jQuery("#"+mb_options["board_name"]+"_category3").hide(); }else if(index==1){ set_category_data(category_data[jQuery("#"+mb_options["board_name"]+"_category1 option:selected").val()],mb_options["board_name"]+"_category2",""); if (jQuery("#"+mb_options["board_name"]+"_category1 option:selected").val()!=""){ set_category_data(category_data[jQuery("#"+mb_options["board_name"]+"_category1 option:selected").val()][jQuery("#"+mb_options["board_name"]+"_category2 option:selected").val()],mb_options["board_name"]+"_category3",""); }else{ set_category_data("",mb_options["board_name"]+"_category3",""); } }else if(index==2){ if (jQuery("#"+mb_options["board_name"]+"_category1 option:selected").val()!=""){ set_category_data(category_data[jQuery("#"+mb_options["board_name"]+"_category1 option:selected").val()][jQuery("#"+mb_options["board_name"]+"_category2 option:selected").val()],mb_options["board_name"]+"_category3",""); }else{ set_category_data("",mb_options["board_name"]+"_category3",""); } } } var mb_selectFileName = ""; function sendBoardFileData(file_pid,file_name){ var data = "mode=file&board_action=file_download&board_name="+mb_options["board_name"]+"&file_pid="+file_pid+"&file_name="+encodeURIComponent(file_name); mb_selectFileName = file_name; sendDataRequest(mb_urls["board_api"], data, sendBoardFileDataHandler); } function sendBoardFileDataHandler(response, state) { if(response.state == "success"){ if(typeof(response.data)!=='undefined' && typeof(response.data.file_path)!=='undefined') downloadFile(mb_urls["file"],"path="+encodeURIComponent(response.data.file_path)); }else{ showAlertPopup(response); } } function downloadFile(url, param){ if(typeof(param)!=='undefined' && param!=""){ if(url.indexOf('?')==-1){ url = url+'?'; }else{ url = url+'&'; } url = url+param; } if(typeof(mb_hybrid_app)==='undefined' || mb_hybrid_app==""){ window.location.href = decodeURIComponent(url+"&type=download&file_name="+mb_selectFileName); }else{ if(mb_hybrid_app=="ios"){ openWindow(decodeURIComponent(url+"&type=download&file_name="+mb_selectFileName)); }else{ window.location.href = decodeURIComponent(url+"&type=download&file_name="+mb_selectFileName); } } } var listTemplateMode = ""; var listTemplateBoard = ""; var listTemplateCheck = true; var listTemplateAction = ""; function sendTabReload(data,idx){ if(typeof(idx)==='undefined') idx = "1"; if(jQuery("input[name=category"+idx+"]")) jQuery("input[name=category"+idx+"]").val(data); sendSearchData(); } function setEditorType(type){ if(document.getElementById("editor_type")){ document.getElementById("editor_type").value = type; } } function sendListTemplateData(data){ listTemplateCheck = true; if(typeof(data)==='undefined') data = {}; if(typeof(data.board_name)==='undefined' || data.board_name==='undefined') board_name = mb_options["board_name"]; else board_name = data.board_name; if(typeof(data.mode)==='undefined' || data.mode==='undefined') mode = ""; else mode = data.mode; if(typeof(data.page)==='undefined' || data.page==='undefined') page = 1; else page = data.page; listTemplateBoard = board_name; listTemplateMode = mode; var params = jQuery('#'+listTemplateBoard+'_form_board_search').serialize(); params = params+"&"+jQuery('#'+listTemplateBoard+'_form_board_list').serialize()+"&board_action=load"; if(typeof(data.category)!=='undefined'){ if(typeof(data.idx)==='undefined') idx = "1"; else idx = data.idx; params = params+"&category"+idx+"="+encodeURIComponent(data.category); }else if(typeof(data.page_type)!=='undefined' && data.page_type=="ajax"){ if(typeof(mb_categorys["value1"])!=='undefined' && mb_categorys["value1"]!=""){ params = params+"&category1="+encodeURIComponent(mb_categorys["value1"]); if(typeof(mb_categorys["value2"])!=='undefined' && mb_categorys["value2"]!=""){ params = params+"&category2="+encodeURIComponent(mb_categorys["value2"]); if(typeof(mb_categorys["value3"])!=='undefined' && mb_categorys["value3"]!=""){ params = params+"&category3="+encodeURIComponent(mb_categorys["value3"]); } } } } if(typeof(data.page_type)!=='undefined'){ params = params+"&page_type="+encodeURIComponent(data.page_type); } params = params+"&board_page="+page; sendDataRequest(mb_urls["template_api"], params, sendListTemplateDataHandler); } function sendListTemplateDataHandler(response, state){ if(listTemplateCheck){ if(response.state == "success"){ if(listTemplateMode!="append"){ jQuery("#"+listTemplateBoard+"_board_body>tr").remove(); jQuery("#"+listTemplateBoard+"_board_body>div").remove(); } if(response.data["body"]) jQuery("#"+listTemplateBoard+"_board_body").append(response.data["body"]); if(response.data["pagination"]!="") jQuery('#'+listTemplateBoard+'_pagination_box').html(response.data["pagination"]); else{ jQuery('#'+listTemplateBoard+'_pagination_box').html(""); } }else{ showAlertPopup(response); } listTemplateCheck = false; } } function getPostcode(type) { if(typeof(mb_hybrid_app)==='undefined' || mb_hybrid_app==""){ new daum.Postcode({ oncomplete: function(data) { var fullAddr = ""; var extraAddr = ""; if(data.userSelectedType === "R"){ fullAddr = data.roadAddress; }else{ fullAddr = data.jibunAddress; } if(data.userSelectedType === "R"){ if(data.bname !== ""){extraAddr += data.bname;} if(data.buildingName !== ""){extraAddr += (extraAddr !== "" ? ", " + data.buildingName : data.buildingName);} fullAddr += (extraAddr !== "" ? " ("+ extraAddr +")" : ""); } //document.getElementById(type+"_postcode").value = data.postcode1+"-"+data.postcode2; document.getElementById(type+"_postcode").value = data.zonecode; document.getElementById(type+"_address1").value = fullAddr; jQuery("#"+type+"_address2").focus(); } }).open(); }else{ openWindow(mb_urls["home"]+"/?mb_app=postcode&type="+type); } } function template_match_handler(type,obj,name,match_type,match_value){ var value = ""; if(type=="checkbox"){ value = jQuery(obj).prop('checked') ? "1":"0"; }else if(type=="radio" || type=="select"){ value = jQuery(obj).val(); }else{ if(jQuery(obj).val()!=""){ value = jQuery(obj).val(); }else{ value = jQuery(obj).find('input').first().val(); } } match_value = ","+match_value+","; value = ","+value+","; var target = jQuery(".combo-"+name); if(match_type=="show"){ if(match_value.indexOf(value)!=-1) target.show(); else{ target.hide(); } }else if(match_type=="hide"){ if(match_value.indexOf(value)!=-1){ target.hide(); }else target.show(); } } function template_combo_handler(type,obj,name){ var value = ""; if(type=="checkbox"){ value = jQuery(obj).prop('checked') ? "1":"0"; }else{ value = jQuery(obj).val(); } var combo_wrapper = jQuery(obj).closest('.mb-combo-wrapper').find('.mb-combo-items'); combo_wrapper.children().hide(); combo_wrapper.find('.mb-combo-'+name+'-'+value).show(); } function checkEnterKey(callback,param){ if(event.keyCode == 13){ if(typeof(param)==='undefined') callback(); else callback(param); } } var openTarget; var openPid = ""; var openColspan = 0; var openColspanIndex = 0; function openContents(obj, name, index, action){ if(typeof(index)!=='undefined') openColspanIndex = index; if(typeof(action)!=='undefined') open_action = action; else open_action = "content"; openTarget = jQuery(obj).closest("tr"); if(openTarget.next().attr("class")=="mb-open-box"){ if(openTarget.next().css("display")=="none"){ openTarget.next().fadeIn('slow'); openTarget.next().find(".mb-open-slide").slideDown("300"); }else{ openTarget.next().fadeOut('slow'); openTarget.next().find(".mb-open-slide").slideUp("300",function(){openTarget.next().hide();}); } }else{ //콘텐츠 데이타 불러오기 if(typeof(name)==='undefined' || name=="") name = mb_options["board_name"]; var board_pid = jQuery(obj).attr("class").split("_").pop(); if(openPid!=(name+board_pid)){ var data = "board_name="+name+"&mode=list&board_action="+open_action+"&board_pid="+board_pid; openPid = name+board_pid; sendDataRequest(mb_urls["template_api"], data, sendContentDataHandler); } } openTarget.find(".mb-icon-box").toggleClass('mb-icon-close'); } function isJsonType(data){ if(data.indexOf("{")!==-1) return true; else return false; } function sendContentDataHandler(response, state){ if(response.state == "success"){ var content_html = ''; var colspan = openTarget.find("td").length; if(openColspanIndex>0){ colspan = colspan - openColspanIndex; for(i=0;i'; } } content_html = content_html+''; openTarget.after(content_html); openTarget.next().hide(); openTarget.next().fadeIn('slow'); openTarget.next().find(".mb-open-slide").slideDown("300"); }else{ showAlertPopup(response); } } function mb_reloadImage_class(name){ if(typeof(name)==='undefined' || name=='') name = "mb_kcaptcha"; var img_url = jQuery("."+name).attr("src"); var timestamp = new Date().getTime(); if(img_url.indexOf('?')==-1){ img_url = img_url+'?time='; }else{ img_url = img_url+'&time='; } img_url = img_url+timestamp; jQuery("."+name).attr("src",img_url) } function mb_reloadImage(id){ if(typeof(id)==='undefined') id = "mb_kcaptcha"; var img_url = jQuery("#"+id).attr("src"); var timestamp = new Date().getTime(); if(img_url.indexOf('?')==-1){ img_url = img_url+'?time='; }else{ img_url = img_url+'&time='; } img_url = img_url+timestamp; jQuery("#"+id).attr("src",img_url) } function checkMaxNumber(obj,max){ if(typeof(max)!=='undefined'){ if(max 57) ){ return false; } } function moveBodyScrollPosition(name,top,time){ if(typeof(top)==='undefined') top = 40; if(typeof(time)==='undefined') time = 0; jQuery("html, body").animate({scrollTop: jQuery(name).offset().top-top}, time); } function imgResize(objImage,nWidth,nHeight) { if(typeof(nWidth)==='undefined') nWidth = 50; if(typeof(nHeight)==='undefined') nHeight = nWidth; nWidth = parseInt(nWidth); nHeight = parseInt(nHeight); var imgFile = new Image(); imgFile.src = objImage.src; var imgWidth = imgFile.width; var imgHeight = imgFile.height; if(imgWidth>imgHeight) { imgHeight = imgHeight * nWidth/imgWidth; imgWidth = nWidth; if(imgHeight>nHeight) { imgWidth = imgWidth * nHeight/imgHeight; imgHeight = nHeight; } } else if(imgWidth<=imgHeight) { imgWidth = imgWidth * nHeight/imgHeight; imgHeight = nHeight; if(imgWidth>nWidth) { imgHeight = imgHeight * nWidth/imgWidth; imgWidth = nWidth; } } else { imgWidth = nWidth; imgHeight = nHeight; } objImage.width = imgWidth; objImage.height = imgHeight; } jQuery(document).ready(function() { if(jQuery.isFunction(jQuery(".tooltip").tipTip)){ jQuery(".tooltip").tipTip(); } //숫자만 입력받기 jQuery(".mbi-only-int").keyup (function () { jQuery(this).val(jQuery(this).val().replace(/[^0-9]/g,"")); }); jQuery(".mbi-only-num").keyup (function () { jQuery(this).val(jQuery(this).val().replace(/[^0-9,.]/g,"")); }); //숫자만 입력받고 최대 자릿수가 되면 다음 포커스로 이동 jQuery(".mbi-next-focus-num").keyup (function () { var maxLength = jQuery(this).attr("maxlength"); jQuery(this).val(jQuery(this).val().replace(/[^0-9]/g,"")); if (this.value.length >= maxLength) { jQuery(this).next('.mbi-next-focus-num').focus(); return false; } }); //텍스트를 입력받고 최대 자릿수가 되면 다음 포커스로 이동 jQuery(".mbi-next-focus").keyup (function () { var maxLength = jQuery(this).attr("maxlength"); if (this.value.length >= maxLength) { jQuery(this).next('.mbi-next-focus').focus(); return false; } }); }); // source --> https://www.gtwins.co.kr/wp-content/plugins/mangboard/plugins/popup/js/main.js?ver=1.7.8 jQuery( document ).ready(function() { //팝업 태그를 body에 추가 var popup_html = ""; popup_html = popup_html+'
'; popup_html = popup_html+'
'; popup_html = popup_html+'
'; popup_html = popup_html+'
'; popup_html = popup_html+'
'; popup_html = popup_html+'
'; popup_html = popup_html+'
'; popup_html = popup_html+'
'; popup_html = popup_html+'
'; popup_html = popup_html+'
'; popup_html = popup_html+'
'; popup_html = popup_html+'
'; popup_html = popup_html+'
'; popup_html = popup_html+'
'; popup_html = popup_html+'
'; popup_html = popup_html+'
'; popup_html = popup_html+'
'; popup_html = popup_html+'
'; popup_html = popup_html+'
'; popup_html = popup_html+'
'; popup_html = popup_html+'
'; jQuery("body").append(popup_html); }); var confirmCallbackSend; var confirmCallbackCancel; var alertCallbackSend; var popupCallbackData; var select_menu = ""; var eventX = 0; var eventY = 0; var scrollMode = true; function setPopupScrollEvent(){ jQuery(window).on({ 'mousewheel': function(e){ if(scrollMode) setPopupPosition("scroll"); },'scroll': function(e){ if(scrollMode) setPopupPosition("scroll"); } }) } function setPopupPosition(mode){ if(typeof(mode)!=='undefined' && mode=="scroll" && jQuery("#mb_pop_bg").css('display')=='none') return; var popupObj = jQuery("#mb_pop_confirm"); popupObj.css('left',(window.innerWidth-popupObj.outerWidth())/2); popupObj.css('top',(jQuery(document).scrollTop()+(window.innerHeight-popupObj.outerHeight())/2)); popupObj = jQuery("#mb_pop_alert"); popupObj.css('left',(window.innerWidth-popupObj.outerWidth())/2); popupObj.css('top',(jQuery(document).scrollTop()+(window.innerHeight-popupObj.outerHeight())/2)); popupObj = jQuery("#mb_pop_info"); popupObj.css('left',(window.innerWidth-popupObj.outerWidth())/2); popupObj.css('top',((jQuery(document).scrollTop()+(window.innerHeight-popupObj.outerHeight())/2))); popupObj = jQuery("#mb_pop_html"); if(popupObj.height()>=window.innerHeight || popupObj.outerWidth()>=window.innerWidth){ popupObj.css('position','fixed'); popupObj.css('height',"100%"); popupObj.css('top',0); popupObj.css('left',0); scrollMode = false; jQuery('body').css('overflow-y','hidden'); }else{ popupObj.css('position','absolute'); popupObj.css('top',(jQuery(document).scrollTop()+(window.innerHeight-popupObj.outerHeight())/2)); popupObj.css('left',(window.innerWidth-popupObj.outerWidth())/2); } } setPopupScrollEvent(); function showConfirmPopup(message,data,send,cancel) { popupCallbackData = data; confirmCallbackSend = send; if(typeof(cancel)==='undefined') confirmCallbackCancel = hidePopupBox; else confirmCallbackCancel = cancel; //위치 설정 var pop_head = ''; var pop_body = ''; if(typeof(data)!=='undefined' && typeof(data.type)!=='undefined' && data.type=="passwd"){ pop_head = '
'+message+'
'; pop_body = pop_body+'
'; pop_body = pop_body+'
'; pop_body = pop_body+'
'; }else{ pop_head = '

Message

'+message+'

'; } pop_body = pop_body+'
'; pop_body = pop_body+''+mb_languages["btn_cancel"]+''; pop_body = pop_body+''+mb_languages["btn_ok"]+''; pop_body = pop_body+'
'; if(typeof(data)!=='undefined'){ if(typeof(data.head)!=='undefined') pop_head = data.head; if(typeof(data.body)!=='undefined') pop_body = data.body; } showPopupBox("Confirm",pop_head,pop_body); } function showAlertPopup(response,send){ if(!response || typeof(response)==='undefined') return; var code = ""; var message = ""; var target_name = ""; if(typeof(send)==='undefined') alertCallbackSend = null; else alertCallbackSend = send; if(typeof(response.code)!=='undefined') code = response.code; if(typeof(response.message)!=='undefined') message = response.message; if(typeof(response.target_name)!=='undefined') target_name = response.target_name; if(message=="") return; var pop_head = '

Message

'+message+'

'; var pop_body = ''; pop_body = pop_body+'
'; pop_body = pop_body+''+mb_languages["btn_ok"]+''; pop_body = pop_body+'
'; showPopupBox("Alert",pop_head,pop_body); } function showPopupBox(type,head,body,data){ scrollMode = true; initLoadingBox(); var popupID = "#mb_pop_confirm"; if(type=="Alert"){ popupID = "#mb_pop_alert"; if(jQuery("#mb_pop_bg").css('display')=='none') jQuery("#mb_pop_confirm").hide(); setTimeout(function(){ jQuery(popupID).addClass("mb-ani-pop-open"); }, 1); }else if(type=="Info"){ popupID = "#mb_pop_info"; }else if(type=="Confirm"){ popupID = "#mb_pop_confirm"; setTimeout(function(){ jQuery(popupID).addClass("mb-ani-pop-open"); }, 1); }else if(type=="Html"){ popupID = "#mb_pop_html"; }else{ popupID = "#mb_pop_alert"; setTimeout(function(){ jQuery(popupID).addClass("mb-ani-pop-open"); }, 1); } if(typeof(data)==='undefined') data = {}; if(typeof(data.position)==='undefined') data.position = "center"; if(typeof(data.bg)==='undefined') data.bg = true; if(typeof(data.eventX)==='undefined') data.eventX = 0; if(typeof(data.eventY)==='undefined') data.eventY = 0; jQuery(popupID+"_head").html(head); jQuery(popupID+"_body").html(body); var adminbarHeight = jQuery("#wpadminbar").height(); if(adminbarHeight==null || typeof(adminbarHeight)==='undefined') adminbarHeight = 0; if(data.position=="click"){ jQuery(popupID).css("top",parseInt((data.eventY+jQuery(document).scrollTop()-adminbarHeight)/10)*10-7); jQuery(popupID).css("left",parseInt(data.eventX/10)*10+30); }else{ setPopupPosition(); } if(data.bg) showPopupBG(); jQuery(popupID).show(); if(type=="Alert"){ jQuery("#mb_pop_alert_ok").focus(); }else if(type=="Confirm"){ jQuery("#mb_confirm_passwd").focus(); } } function initLoadingBox(){ jQuery("#mb_pop_html_head").html(""); jQuery("#mb_pop_html_body").html(""); } function showLoadingBox(){ showPopupBox("Html",'','
Loading
'); } function hideLoadingBox(){ initLoadingBox(); if(jQuery("#mb_pop_alert").css('display')=='none' && jQuery("#mb_pop_confirm").css('display')=='none'){ jQuery("#mb_pop_bg").hide(); } } function showPopupBG(){ hideInfoBox(); jQuery('#mb_pop_bg').height(jQuery(document).height()); jQuery("#mb_pop_bg").show(); } function getUserMenu(uid,pid){ var menu_options = "*"; if(select_menu==uid+"_"+pid){ select_menu = ""; hideInfoBox(); }else{ sendUserMenu(uid,pid,menu_options,event); select_menu = uid+"_"+pid; } } function showUserMenu(data){ var menu_head = data["head"]; var menu_body = ""; var menu_foot = data["foot"]; menu_head = menu_head+'
'+data["user"]["name"]+'
'; menu_body = ''; showPopupBox("Info","",('
'+menu_head+menu_body+menu_foot+"
"),{"position":"click","bg":false,"eventX":eventX,"eventY":eventY}); } } function sendUserMenu(uid,board_pid,option,event){ if(typeof(event)!=='undefined'){ eventX = event.clientX; eventY = event.clientY; } if(option=="*") option = "search,info,email,homepage,blog"; var param = "board_name="+mb_options["board_name"]+"&option="+option+"&list_type="+mb_options["list_type"]+"&page="+mb_options["page"]; if(jQuery('#'+mb_options["board_name"]+'_form_board_search')) param += "&"+jQuery('#'+mb_options["board_name"]+'_form_board_search').serialize(); param += "&mode=user&board_action=menu"+"&pid="+uid+"&board_pid="+board_pid; sendDataRequest(mb_urls["template_api"], param, sendUserMenuHandler); } function sendUserMenuHandler(response, state){ if(response.state == "success"){ showUserMenu(response.data); }else{ showAlertPopup(response); } } function hideInfoBox() { jQuery("#mb_pop_info").hide(); } function hidePopupBox() { confirmCallbackSend = null; jQuery(".input-focus").removeClass("input-focus"); jQuery("#mb_pop_info").hide(); jQuery("#mb_pop_html").hide(); jQuery("#mb_pop_confirm").hide(); jQuery("#mb_pop_confirm").removeClass("mb-ani-pop-open"); jQuery("#mb_pop_alert").removeClass("mb-ani-pop-open"); jQuery("#mb_pop_bg").hide(); if(!scrollMode){ jQuery('body').css('overflow-y','auto'); scrollMode = true; } } function showAlertCallback(code,target_name) { hidePopupAlert(code,target_name); sendAlertCallbackData(); } function hidePopupAlert(code,target_name) { if(typeof(code)!=='undefined' && code!=='undefined'){ if(confirmCallbackSend) jQuery("#mb_pop_confirm").show(); if(code.substr(0,2)=="12"){ //입력 관련 에러일 경우 포커스 설정 var target; if(jQuery("#mb_pop_confirm").css('display')!='none'){ if(target_name!="") target = jQuery("#mb_confirm_form").find("input[name="+target_name+"]"); }else{ target = document.getElementsByName(target_name); } jQuery(".input-focus").removeClass("input-focus"); if(typeof(target)!=='undefined'){ jQuery(target).addClass("input-focus"); jQuery(target).focus(); } } }else{ jQuery(".input-focus").focus(); } jQuery("#mb_pop_alert").hide(); jQuery("#mb_pop_alert").removeClass("mb-ani-pop-open"); jQuery("#mb_pop_html").hide(); jQuery("#mb_pop_info").hide(); if(jQuery("#mb_pop_confirm").css('display')=='none'){ jQuery("#mb_pop_bg").hide(); initLoadingBox(); } if(!scrollMode){ jQuery('body').css('overflow-y','auto'); scrollMode = true; } } function sendAlertCallbackData() { if(alertCallbackSend) alertCallbackSend(); else alertCallbackSend = null; } function sendConfirmCallbackData() { showLoadingBox(); jQuery("#mb_pop_confirm").hide(); if(confirmCallbackSend) confirmCallbackSend(popupCallbackData); else confirmCallbackSend = null; } function cancelConfirmCallbackData() { confirmCallbackSend = null; if(confirmCallbackCancel) confirmCallbackCancel(); else confirmCallbackCancel = null; }; // source --> https://www.gtwins.co.kr/wp-content/plugins/mangboard/plugins/datepicker/js/datepicker.js?ver=1.7.8 jQuery(function($){ if($.datepicker && $.datepicker.regional){ $.datepicker.regional["ko"] = { closeText: "닫기", prevText: "이전달", nextText: "다음달", currentText: "오늘", monthNames: ["1월(JAN)","2월(FEB)","3월(MAR)","4월(APR)","5월(MAY)","6월(JUN)", "7월(JUL)","8월(AUG)","9월(SEP)","10월(OCT)","11월(NOV)","12월(DEC)"], monthNamesShort: ["1월","2월","3월","4월","5월","6월", "7월","8월","9월","10월","11월","12월"], dayNames: ["일","월","화","수","목","금","토"], dayNamesShort: ["일","월","화","수","목","금","토"], dayNamesMin: ["일","월","화","수","목","금","토"], weekHeader: "Week", dateFormat: "yymmdd", firstDay: 0, isRTL: false, showMonthAfterYear: true, yearSuffix: "" }; $.datepicker.setDefaults($.datepicker.regional["ko"]); } }); jQuery(document).ready(function() { if(jQuery(".show-datepicker").datepicker) jQuery(".show-datepicker").datepicker({ changeMonth: true, changeYear: true, dateFormat: "yy-mm-dd", showButtonPanel: true, yearRange: "c-100:c+10"}); });